package com.cy.observer;


import java.util.Observable;
import java.util.Observer;
/** 
 * <br>@class: ConcreteObserver
 * <br>@description: 
 * <br>@author: cy
 * <br>@date: 2020-03-28 17:47:40
 * <br>@version: 1.0
 * <br>
 * <br>@since: (版本) 作者 时间 注释 
 */
public class ConcreteObserver implements Observer {
    private String sub_name;
    private String ob_name;



    public ConcreteObserver(Observable obsv,String ob_name) {
        super();
        obsv.addObserver(this);
       this.ob_name =  ob_name;
    }


    @Override
    public void update(Observable o, Object arg) {

        System.out.println("ConcreteObserver.update");
        if (arg != null) {
            System.out.println("收到指令:<" + arg+"> 我是:"+ob_name);
        }
    }


}
